import React,{useState,useEffect} from 'react'
import axios from 'axios'
import './deta.css'
import { NavBar,Space } from 'antd-mobile'
import { SearchOutline, MoreOutline, CloseOutline } from 'antd-mobile-icons'

export default function Index() {
    let [date,setdate] = useState([])
    const right = (
      <div style={{fontSize: 24}}>
        <Space style={{ '--gap': '16px' }}>
        <MoreOutline />
      </Space>
      </div>
    )

    const back = ()=>{
      console.log('返回');
    }

    const getlist = async()=>{
        let {data} = await axios.get("http://127.0.0.1:3000/shr/getlistgt")
        setdate(data.data);
        // console.log(data.data);
    }
    useEffect(()=>{
        getlist()
        console.log(date,1);
    },[])
  return (
    <div>
      <NavBar right={right} onBack={back}>动态详情</NavBar>
      <div className='deta-header'>
        {
          date.length==0?'123':<>
              <div className='deta-tit'>{date[0].title}</div>
        <div className='tp-deta'>
          
          {
            date[0].image.map((item,index)=>{
              return (
                <div className='tpp-deta'>
                  <img src={item} alt=""  style={{width:'30vw',height:'15vh'}}/>
                </div>
              )
            })
          }
        </div>
              
          </>
        }
        {/* <div className='deta-tit'>{date[0].title}</div>
        <div className='tp-deta'>
          
          {
            date[0].image.map((item,index)=>{
              return (
                <div className='tpp-deta'>
                  <img src={item} alt=""  style={{width:'30vw',height:'15vh'}}/>
                </div>
              )
            })
          }
        </div> */}
      </div>
      <div className='blllk'></div>
    </div>
  )
}
